﻿// Copyright 2007-2008 Rory Plaire (codekaizen@gmail.com)

namespace NPack.Interfaces
{
    /// <summary>
    /// Every class that defines a / operation 
    /// like <c>TQuotient operator / (IDivisible`2 a, TDivisor b)</c> should consider
    /// implementing this interface.
    /// </summary>
    /// <typeparam name="TDivisor">
    /// Type which divides the <see cref="IDivisible{TDivisor, TQuotient}"/> instance.
    /// </typeparam>
    /// <typeparam name="TQuotient">Result type of the division operation.</typeparam>
    /// <remarks>
    /// Adapted from an article on lambda-computing.com: 
    /// http://www.lambda-computing.com/publications/articles/generics/IArithmetic.cs.
    /// </remarks>
    public interface IDivisible<TDivisor, TQuotient>
    {
        /// <summary>
        /// Returns the quotient of the Object and <paramref name="b"/>.
        /// It must not modify the value of the Object.
        /// </summary>
        /// <param name="b">The second operand.</param>
        /// <returns>The quotient.</returns>
        TQuotient Divide(TDivisor b);
    }
}
